﻿using System;
using UnityEngine;

namespace UniRx.Triggers
{
	// Token: 0x02000445 RID: 1093
	[DisallowMultipleComponent]
	public class ObservableTransformChangedTrigger : ObservableTriggerBase
	{
		// Token: 0x060016F6 RID: 5878 RVA: 0x00062A00 File Offset: 0x00060E00
		private void OnBeforeTransformParentChanged()
		{
			if (this.onBeforeTransformParentChanged != null)
			{
				this.onBeforeTransformParentChanged.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016F7 RID: 5879 RVA: 0x00062A20 File Offset: 0x00060E20
		public IObservable<Unit> OnBeforeTransformParentChangedAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onBeforeTransformParentChanged) == null)
			{
				result = (this.onBeforeTransformParentChanged = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016F8 RID: 5880 RVA: 0x00062A48 File Offset: 0x00060E48
		private void OnTransformParentChanged()
		{
			if (this.onTransformParentChanged != null)
			{
				this.onTransformParentChanged.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016F9 RID: 5881 RVA: 0x00062A68 File Offset: 0x00060E68
		public IObservable<Unit> OnTransformParentChangedAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onTransformParentChanged) == null)
			{
				result = (this.onTransformParentChanged = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016FA RID: 5882 RVA: 0x00062A90 File Offset: 0x00060E90
		private void OnTransformChildrenChanged()
		{
			if (this.onTransformChildrenChanged != null)
			{
				this.onTransformChildrenChanged.OnNext(Unit.Default);
			}
		}

		// Token: 0x060016FB RID: 5883 RVA: 0x00062AB0 File Offset: 0x00060EB0
		public IObservable<Unit> OnTransformChildrenChangedAsObservable()
		{
			Subject<Unit> result;
			if ((result = this.onTransformChildrenChanged) == null)
			{
				result = (this.onTransformChildrenChanged = new Subject<Unit>());
			}
			return result;
		}

		// Token: 0x060016FC RID: 5884 RVA: 0x00062AD8 File Offset: 0x00060ED8
		protected override void RaiseOnCompletedOnDestroy()
		{
			if (this.onBeforeTransformParentChanged != null)
			{
				this.onBeforeTransformParentChanged.OnCompleted();
			}
			if (this.onTransformParentChanged != null)
			{
				this.onTransformParentChanged.OnCompleted();
			}
			if (this.onTransformChildrenChanged != null)
			{
				this.onTransformChildrenChanged.OnCompleted();
			}
		}

		// Token: 0x04000CCF RID: 3279
		private Subject<Unit> onBeforeTransformParentChanged;

		// Token: 0x04000CD0 RID: 3280
		private Subject<Unit> onTransformParentChanged;

		// Token: 0x04000CD1 RID: 3281
		private Subject<Unit> onTransformChildrenChanged;
	}
}
